home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / math / maca_101.zip / EQUATION.DEM < prev    next >
Text File  |  1996-01-30  |  3KB  |  101 lines

  1. ;EQUATION.DEM
  2. ;DEMO FILE FOR MASSCALC VERSION 1.00
  3. ;WRITTEN BY: Ralph W. Reid
  4. ;This file may only be distributed in its unmodified form.
  5. ;
  6. ;DESCRIPTION:  This file primarily demonstrates equation formats.
  7. ;
  8. ;For the latest releases of MASSCALC and other software created by
  9. ;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
  10. ;
  11. ;HOW TO USE THIS FILE:  This file may be piped into MASSCALC, and its
  12. ;output displayed as follows:
  13. ;TYPE EQUATION.DEM | MASSCALC | MORE
  14. ;This file may be redirected into MASSCALC and its output displayed
  15. ;as follows:
  16. ;MASSCALC < EQUATION.DEM | MORE
  17. ;These two commands should be run from the operating system prompt.
  18.  
  19. ;the simplest equation (a single value)
  20. print: "A simple value:"
  21. 29.5;
  22.  
  23. ;a predefined constant as an equation
  24. print: "A predefined constant (_e):"
  25. _e;
  26.  
  27. ;some simple additions
  28. print:
  29. print: "some results from a few simple additions:"
  30. 1+1;
  31. _pi + _pi;
  32. 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10;
  33.  
  34. ;some more simple equations
  35. print:
  36. print: "results from some more simple equations:"
  37. 1 / 2;
  38. 2 ^ 3;
  39. 3 * 5 / 10 - 0.5;
  40. -4 + 2 ^ 2 * _pi / 8.2;
  41.  
  42. ;include some functions
  43. print:
  44. print: "results of some equations which include functions:"
  45. sin (_pi / 2) + cos (4 - 2 ^ 2);
  46. 3 ^ sin (_pi_2) + log (100);
  47.  
  48. ;include parentheses in equations
  49. print:
  50. print: "results from equations including parentheses:"
  51. 2 ^ (1 + 3);
  52. (sin (_pi / 2) + log_b (2, 2)) ^ log (100);
  53. 1 / (floor (exp (1)) * sin (_pi / 2));
  54.  
  55. ;equations with variables
  56. print:
  57. print: "results from some equations which include variable assignments:"
  58. var1;
  59. var1 = 1 + floor (sin (_pi / 2)) * log (10);
  60. var1;
  61. var1 = 2;
  62. pi = _PI;
  63. final = sin (pi / var1) + log_b (var1, var1);
  64. final = final * 5;
  65. final;
  66.  
  67. ;split some equations across several lines
  68. ;The length of any equation is the total length of all of its lines
  69. ;added together; this total must not exceed the maximum line length
  70. ;set by MASSCALC.
  71. print:
  72. print: "results from equations spread across more than one input line:"
  73. sin (_pi / 2) +
  74. 1 ^ 2e5
  75. + floor (sin (0));
  76. sin (_pi / 2) / cos (_pi / 2) -
  77. tan (_pi / 2);
  78. ln (exp (1))
  79. + log (10) ^ 18
  80. - 2 +
  81. log_b (var1, var1);
  82.  
  83. ;using special function results in equations
  84. print:
  85. print: "adding some results of special functions to equations:"
  86. root value = root_secant (x, 1, 2, x - sqrt (2));
  87. root value ^ 2;
  88.  
  89. root value / sqrt (2)
  90. + 1;
  91.  
  92. x = 3;
  93. der value = derivative_1 (x, x^2);
  94. der value = ceil (der value);     removes approximation error for this value
  95. der value;
  96.  
  97. root value / _sqrt_2
  98. * der value
  99. + log_b (3, 3^4);
  100.  
  101.